//
//  Merchant.m
//  reSearchDemo
//
//  Created by 云库 on 15/7/20.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "Merchant.h"
#import "MenuView.h"
@interface Merchant ()<UITableViewDelegate>
@property(nonatomic,retain)MenuView * menuView;
@end

@implementation Merchant

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor groupTableViewBackgroundColor];
    [self setRightBarButtonImage:LOADIMAGE(@"btn_more") highlightedImage:nil selector:@selector(menu)];
    
    UIView *actionbar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 44)];
    self.navigationItem.titleView = actionbar;
    UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(8, 0, 100, 40)];
    lab.text = @"我是商家";
    lab.font = [UIFont systemFontOfSize:20];
    lab.textColor = [UIColor whiteColor];
    [actionbar addSubview:lab];
}
#pragma mark --菜单列表弹出方法--
-(void)menu{
    NSArray * arr = nil;
    //    if ([share.uid isEqualToString:[BSEngine currentUserId]]) {
    //        arr = @[@"发送给朋友", @"保存到手机", @"收藏", @"删除"];
    //    } else {
    arr = @[@"开通云平台", @"帮助中心"];
    //    }
    _menuView = [[MenuView alloc] initWithButtonTitles:arr withDelegate:self];
    _menuView.hasImage = NO;
    [_menuView showInView:self.view origin:CGPointMake(self.view.width - 180, 70)];
    _menuView.buttonView.delegate=self;
}

#pragma --
#pragma mark --tableviewDelegate--
//cell点击方法
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [_menuView hide];
    if (indexPath.row) {
        
    }else{
        
    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
